SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwtCupos
AS
SELECT     dbo.tb_cupos.idcupo AS ID, dbo.tb_cupos.CicloLectivo, dbo.tb_Organizaciones.Nombre AS Organizacion, 
                      dbo.tb_GrupoDeCarreras.descripcion AS Carrera, dbo.tb_cupos.Curso, dbo.tb_cupos.CantidadDeCupos, dbo.tb_cupos.CantidadDeDivisiones, 
                      dbo.tb_Organizaciones.CUISE
FROM         dbo.tb_cupos INNER JOIN
                      dbo.tb_Organizaciones ON dbo.tb_cupos.Organizacion = dbo.tb_Organizaciones.idOrganizaciones INNER JOIN
                      dbo.tb_GrupoDeCarreras ON dbo.tb_cupos.Carrera = dbo.tb_GrupoDeCarreras.idGrupoCarrera
GO
GRANT SELECT ON  [dbo].[vwtCupos] TO [Alumnos]
GRANT SELECT ON  [dbo].[vwtCupos] TO [Coordinaciones]
GRANT SELECT ON  [dbo].[vwtCupos] TO [SoloVer]
GO
